package priv.mill;

import java.io.InputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import priv.mill.factory.YamlFactory;
import priv.mill.util.MapUtil;

public class Person {

	private String name;
	private Integer age;
	private Character sex;
	private Date date;
	
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	public Character getSex() {
		return sex;
	}
	public void setSex(Character sex) {
		this.sex = sex;
	}
	
	
	public Person() {
	}
	@Test
	public void one() throws Exception {
		Map<String, Object> map = new HashMap<>();
		
		Person obj = new Person();
		obj.setName("张三");
		MapUtil.INSTANCE.entity2Map(obj, map);
		System.out.println(map);
	}
	
	@Override
	public String toString() {
		return "Person [name=" + name + ", age=" + age + ", sex=" + sex + ", date=" + date + "]";
	}
	@Test
	public void one1() throws Exception {
		InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream("class.yaml");
		Map<String,Object> objectList = YamlFactory.INSTANCE.getObjectMap( "class.yaml","test");
		System.out.println(objectList);
	}
	
}
